<?php
namespace App\Http\Controllers\Api\V2;
use Illuminate\Http\Request;
use Validator;
use App\Http\Controllers\Controller;
use App\Models\V1\AudioModel;
use App\Common\ApiData;

class AudioController extends Controller{



    /**
     * 每日一言
     * @return \Illuminate\Http\JsonResponse
     */
    public function getAudioDayList()
    {
        $audioModel = new AudioModel();
        $audios     = $audioModel->get_audio_all();
        return response()->json(['message' => 'ok', 'code' => '200', 'dayslist' => $audios]);
    }


    /**
     * 记录浏览次数
     * */
    public function record_view_times(Request $request){
        $audioId    = $request->input('audioId');
        $audioModel = new AudioModel();
        $audioModel->add_audio_view_times($audioId);
        $apiData    = new ApiData();
        $apiData->message   = "ok";
        $apiData->code      = "200";
        return $apiData->send();
    }




}